package org.noote.roby.monitor;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Main_Activity extends Activity implements OnClickListener {
	private static final String LOG_TAG = "Main_Activity";

	public static final String PREFS_NAME = "Robot_Core_Controller";
	public static final String PREFS_NAME_SERVER_PORT = "server_port";
	public static final String PREFS_NAME_SCAN_MIN = "scan_min";
	public static final String PREFS_NAME_SCAN_MAX = "scan_max";
	public static final String PREFS_NAME_CONTROLLER_NAME = "controller_name";
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
                	
        Button buttonController = (Button)findViewById(R.id.buttonController);
        buttonController.setOnClickListener(this);
    }

	@Override
	public void onClick(View v) {
		switch(v.getId())
    	{
	    	
	    	case R.id.buttonController:
	    	{
	    		launchAsRobotController();
	    		break;
	    	}
    	}
	}

	private void launchAsRobotController() {
		Log.d(LOG_TAG, "launchAsRobotController()");
		
		Intent intent = new Intent(this, SearchConnexion_Activity.class);
		startActivity(intent);
	}

	@Override
	public void onBackPressed()
	{
		Log.d(LOG_TAG, "finish()");
		
		finish();
	}
}